package nu.aop.controller;

import java.util.List;

import javax.annotation.Resource;

import nu.aop.model.GroupHitsVO;
import nu.aop.model.StatisticPointVO;
import nu.aop.model.StatisticVO;
import nu.aop.service.StatisticService;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class StatisticController {
	@Resource(name="statisticService")
	private StatisticService statisticService;
	
	@RequestMapping("showStatisticPage.nu")
	public ModelAndView showStatisticPage(String id)throws Exception{
		GroupHitsVO ghvo = statisticService.selectGroupHitsById(id);
		List<StatisticPointVO> list = statisticService.selectListStatisticPoint(id);
		StatisticVO statVO = new StatisticVO(ghvo,list);
		return new ModelAndView("statistic/statisticPage","statVO",statVO);
	}
}
